package com.iscale.model.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.toolkit.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;


/**
 * <p>
 * 品牌管理
 * </p>
 *
 * @author Andychen
 * @since 2017-03-10
 */
@SuppressWarnings("serial")
@JsonIgnoreProperties(ignoreUnknown = true)  // value={"merchantNo"} 过滤某些字段 json时候输出，或在属性get 方法上 @JsonIgnore
@TableName("base_brand_info")
public class BaseBrandInfo extends Model<BaseBrandInfo> {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ID_WORKER)//分布式全局唯一 IdType.ID_WORKER
	private Long id;
    /**
     * 品牌类型 0-系统定义的  1-商家自定义
     */
	private Integer ptype;
	/**
	 * 商户编号
	 */
	@TableField("merchantNo")
	private String merchantNo;
    /**
     * 品牌名称
     */
	private String name;
    /**
     * 描述
     */
	private String description;
    /**
     * 品牌图片url
     */
	@TableField("logoFile")
	private Long logoFile;
	/**
	 * 文件路径
	 */
	@TableField("logoUrl")
	private String logoUrl;
	@TableField("createTime")
	private Date createTime;
	@TableField("createUser")
	private String createUser;
	@TableField("updateTime")
	private Date updateTime;
	@TableField("updateUser")
	private String updateUser;
    /**
     * 排序
     */
	private Long rank;
    /**
     * 品牌状态 0-有效 1-无效
     */
	private Integer status;


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Integer getPtype() {
		return ptype;
	}

	public void setPtype(Integer ptype) {
		this.ptype = ptype;
	}

	public String getMerchantNo() {
		return merchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		this.merchantNo = merchantNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getLogoFile() {
		return logoFile;
	}

	public void setLogoFile(Long logoFile) {
		this.logoFile = logoFile;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public Long getRank() {
		return rank;
	}

	public void setRank(Long rank) {
		this.rank = rank;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	public String getLogoUrl() {
		return logoUrl;
	}

	public void setLogoUrl(String logoUrl) {
		this.logoUrl = logoUrl;
	}

	public BaseBrandInfo(){}

	public BaseBrandInfo(Long id,String merchantNo, String name, String description, Long logoFile, String createUser, Integer status,String logoUrl) {
		this( merchantNo,  name,  description,  logoFile,  createUser,  status, logoUrl);
		this.id = id;
	}

	public BaseBrandInfo(String merchantNo, String name, String description, Long logoFile, String createUser, Integer status,String logoUrl) {
		this.merchantNo = merchantNo;
		this.name = name;
		this.description = description;
		this.logoFile = logoFile;
		this.createUser = createUser;
		this.status = status;
		this.logoUrl = logoUrl;
		if(StringUtils.isEmpty(merchantNo)){
			this.ptype = 0;//系统品牌
		}else{
			this.ptype = 1;
		}
		this.createTime = new Date();
	}
}
